package cn.aopmin.controller;

import cn.aopmin.api.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * web接口
 * @author aopmin
 * @since 2024/12/29
 */
@RestController
public class HelloController {

    // 注入远程服务, 设置超时时间:1s和重试次数:2次
    @DubboReference(timeout = 1000, retries = 1)
    private HelloService helloService;

    @GetMapping("/hello")
    public String hello() {
        return helloService.getMsg();
    }
}